]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
remoteSearch: Let remote search providers not provide an icon
authorDebarshi Ray <debarshir@gnome.org>
Fri, 6 Dec 2013 11:56:43 +0000 (12:56 +0100)
committerDebarshi Ray <debarshir@gnome.org>
Tue, 10 Dec 2013 16:01:42 +0000 (17:01 +0100)
The documentation indicates that they are optional, so let us make the
code behave accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=719965

js/ui/remoteSearch.js

index 4e7574c5a96ac51bd1ffb7f714460b81f1ff8c74..05a6ae927636c82b1c0ce7bf3c6b61a532348566 100644 (file)
@@ -191,7 +191,9 @@ const RemoteSearchProvider = new Lang.Class({
     },
 
     createIcon: function(size, meta) {
-        let gicon;
+        let gicon = null;
+        let icon = null;
+
         if (meta['icon']) {
             gicon = Gio.icon_deserialize(meta['icon']);
         } else if (meta['gicon']) {
@@ -203,8 +205,10 @@ const RemoteSearchProvider = new Lang.Class({
                                                        bitsPerSample, width, height, rowStride);
         }
 
-        return new St.Icon({ gicon: gicon,
-                             icon_size: size });
+        if (gicon)
+            icon = new St.Icon({ gicon: gicon,
+                                 icon_size: size });
+        return icon;
     },
 
     filterResults: function(results, maxNumber) {